<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head th:replace="common :: header"/>
<body style="background-color: #fff">
    <style>
        .dm-form{padding-top: 20px; padding-left: 50px;}
        .dm-form tr{height: 50px;}
        .dm-form input{width: 260px}
        .dm-label{width: 80px;padding-right: 15px;text-align: right}
    </style>
    <form id="form" class="dm-form" method="post" action='/system/dept/insert'>
        <table>
            <tr th:if="${dept.parentId!=0}">
                <td class="dm-label">上级部门</td>
                <td class="dm-content">
                    <input id="input_parentId" name="parentId" th:value="${dept.parentId}">
                </td>
            </tr>
            <tr>
                <td class="dm-label">部门名称</td>
                <td class="dm-content">
                    <input class="easyui-textbox" name="deptName" data-options="required:true">
                </td>
            </tr>
            <tr style="height: 100px">
                <td class="dm-label">部门说明</td>
                <td class="dm-content">
                    <input class="easyui-textbox" data-options="multiline:true" name="remark" style="height:80px">
                </td>
            </tr>
        </table>
    </form>
<script type="text/javascript">
    $(function() {

        $('#input_parentId').combotree({
            url: '/system/dept/tree',
            editable: false,
            formatter: function (node) {
                if(node.value==1) return '';
                else return node.text;
            }
        });

        $('#input_status').combobox({
            data: [{value:0,text:'正常'},{value:1,text:'停用'}],
            panelHeight: 'auto',
            editable: false
        })

    });

    function submitHandler(index) {
        dm.save('form', function() {
            parent.layer.close(index);
            parent.dm.search('table', null, 'treegrid');
        })
    }
</script>
</body>
</html>
